<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editModal-{{ $todo->id }}">
  <i class="fa fa-btn fa-cog"></i>
</button>

<!-- Modal -->
<div class="modal fade" id="editModal-{{ $todo->id }}" tabindex="-1" role="dialog" aria-labelledby="editModalLabel-{{ $todo->id }}" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="editModalLabel-{{ $todo->id }}">编辑任务</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        
        
        {!! Form::model($todo, ['route'=>['tasks.update',$todo->id],'method'=>'PATCH']) !!}
        
        {!! Form::label('name', '任务名称',) !!}
        {!! $errors->getBag('update-'.$todo->id)->first('name','<div class="alert alert-danger">:message</div>') !!}
        
        {!! Form::text('name',null,['class'=>'form-control']) !!}
        
        {!! Form::label('project_id', '所属项目',) !!}
       {!! Form::select('project_id',$projects,null, ['class'=>'form-control']) !!}
       {!! $errors->getBag('update-'.$todo->id)->first('project_id','<div class="alert alert-danger">:message</div>') !!}
     
      </div>
      <div class="modal-footer">
        
        {!! Form::submit('提交', ['class'=>"btn btn-primary"]) !!}
        
      
      </div>
      {!! Form::close() !!}
    </div>
  </div>
</div>